\(~\)

Static Map - Cheatham Wildlife Management Area

state <- map_data("state")
county <- map_data("county")
cheatham_wma <- data.frame("x" = -87.062749, "y" = 36.190958)

tn <- county %>% 
  filter(region=="tennessee")

cheatco <- county %>% 
  filter(region=="tennessee") %>% 
  filter(subregion=="cheatham")

ggplot() + geom_polygon(data = state, aes(x=long, y = lat, group = group),
                        fill = "white", color="black") + 
           geom_polygon(data = tn, aes(x=long, y = lat, group = group),
                        fill = "tan", color="black") + 
           geom_polygon(data = cheatco, aes(x=long, y = lat, group = group),
                        fill = "green", color="black") + 
           geom_point(data = cheatham_wma, aes(x=x,y=y), color="black") +
  coord_fixed(xlim = c(-91, -81),  ylim = c(34, 37), ratio = 1.2) + 
  xlab("Longitude") + ylab("Latitude") + ggtitle("Cheatham WMA, Cheatham Co., TN")

\(~\)

Interactive - Louisiana Waterthrush Behavior at Cheatham

lowa_locations <- readOGR("data/lowa.kml")
## OGR data source with driver: KML 
## Source: "C:\Users\nsell\Documents\Advanced Analytics\basic-mapping-hw\data\lowa.kml", layer: "lowa"
## with 18 features
## It has 2 fields
lowa_locations@data$Description <- c("Male and Female Foraging", "Pair Foraging", "Pair in Tributary", "Countersinging", "Male w/ Unbanded Female", "Countersinging", "Pair Turned Around", "Male Countersinging to Barry B", "Countersinging", "Nesting", "Foraging", "Foraging", "Fecal Sacs", "Foraging", "Singing", "Captured in Net", "Male w/ fledglings", "Countersinging")



leaflet(lowa_locations) %>% 
   addTiles(group = "OSM")%>%
  addProviderTiles(providers$CartoDB.Positron, group = "CartoDB") %>%
  addProviderTiles(providers$Esri.NatGeoWorldMap, group = "NatGeo") %>%
  addProviderTiles(providers$Esri.WorldImagery, group = "ESRI") %>%
    setView(lng = -87.062971, lat = 36.187153, zoom = 15) %>%
  addCircleMarkers(popup = lowa_locations@data$Description,
                   label = lowa_locations@data$Name,
                   weight = 2,
                   color = "grey",
                   fillColor = "blue",
                   fillOpacity = 0.7)%>%
  addLayersControl(
    baseGroups = c("ESRI", "OSM", "CartoDB", "NatGeo"),
    options = layersControlOptions(collapsed = FALSE))

\(~\)

10 Places in Utah Better Than Zion

utah <- readOGR("data/utah_sites.kml")
## OGR data source with driver: KML 
## Source: "C:\Users\nsell\Documents\Advanced Analytics\basic-mapping-hw\data\utah_sites.kml", layer: "Untitled layer"
## with 10 features
## It has 2 fields
utah <- data.frame(utah)

pts <- st_as_sf(data.frame(utah),
                coords = c("coords.x1", "coords.x2"), crs = 4326)

img <- c("images/muley.jpg", "images/cave_canyon_tower.jpg", "images/citadel.jpg", "images/calf_creek.jpg", "images/abajo.jpg", "images/castle_valley.jpg", "images/needles(1).jpg", "images/fruita.jpg", "images/moki_canyon.jpg", "images/natural_bridges.jpg")

pts$img <- img

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pts, group = "pts") %>%
  addPopupImages(pts$img, group = "pts", width = 500)
#(utah) %>% 
#   addTiles(group = "OSM")%>%
#  addProviderTiles(providers$Esri.WorldImagery, group = "ESRI") %>%
 #   setView(lng = -110.614690, lat = 37.746282, zoom = 7.5) %>%
  #addCircleMarkers(label = utah@data$Name,
       #            weight = 1,
                   #color = "grey",
                   #fillColor = "green",
                   #fillOpacity = 0.7)